<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      //Object.isExtensible 是否可以添加属性
      let obj = {};
      // true，表示可扩展
      console.log(Object.isExtensible(obj)); //true 可以扩展
      let obj2 = {};
      Object.preventExtensions(obj2);
      // false，表示不可添加新属性
      console.log(Object.isExtensible(obj2)); //false 不可扩展
    </script>
  </body>
</html>
